<?php
header("Content-Type: text/html;charset=utf-8");

$wd = $_GET["wd"];

//搜腾讯vip
$unwd =  urlencode($wd);
//$url="https://v.qq.com/x/search/?q=$unwd&stag=0&smartbox_ab=";
//$aaa= file_get_contents($url);

//$result = preg_match('/<h2 class="result_title">.*<\/span>/', $aaa, $bbb);

//preg_match_all('/".*?"/', $bbb[0], $ccc);
//var_dump($ccc);exit;
//$ccc[0][1]= ltrim($ccc[0][1],'"');
//$ccc[0][1] = rtrim($ccc[0][1],'"');
//$real = strstr($ccc[0][1],"v.qq.com/x/cover/");
//if(!$real){
//    $ddd= file_get_contents($ccc[0][1]);
//    preg_match_all('/<a href=".*"\s*target="_blank"\s*itemprop="url"\s>.*\s.*alt="会员"/', $ddd, //$eee);
//$eee[0]= array_slice($eee[0],-2,2);
//var_dump($eee[0]);exit;
//    foreach($eee[0] as $k =>$vv){
//        preg_match_all('/".*?"/', $vv, $a);
//        preg_match('/<span itemprop="episodeNumber">.*<\/span>/', $vv, $b);
//        $uu = urlencode($a[0][0]);
//       $book = array("a"=>$uu);
//        $json= urldecode(json_encode($book['a']));
//        $json=explode('"',$json);
//        $b[0] = ltrim($b[0],'<span itemprop="episodeNumber">');
//       $b[0] = rtrim($b[0],'</span>');

//        $url=json_decode(file_get_contents('http://api.t.sina.com.cn/short_url/shorten.json?source=3271760578&url_long=http://api.bbbbbb.me/jx/?url='.$json[2]),true);
//        $url_short = $url[0]['url_short'];
//            echo '【腾讯】'.$wd;echo $b[0].'集';echo "<br>";echo $url_short;echo "<br>"   ;
//    }
//}else{
//    $uu = urlencode($ccc[0][1]);
//    $book = array("a"=>$uu);
//    $json= urldecode(json_encode($book['a']));
//    $json=explode('"',$json);
//    $url=json_decode(file_get_contents('http://api.t.sina.com.cn/short_url/shorten.json?source=3271760578&url_long=http://api.bbbbbb.me/jx/?url='.$json[1]),true);
//   $url_short = $url[0]['url_short'];
//  echo '【腾讯】'.$wd;echo "<br>";echo $url_short;echo "<br>";
//}
//$tx_url_short= $url_short;
//搜在线
$ddd = file_get_contents("http://v.sigu.me/search.php?wd=$wd");

$result1 = preg_match_all('/<span class="s_tit">(.*?)<span class="s_type">/', $ddd, $name);

foreach($name[0] as $vv){

    preg_match_all('/".*?"/', $vv, $aa);
    preg_match('/<strong>.*<\/strong>/', $vv, $bb);

    $uu = urlencode('v.sigu.me/'.$aa[0][1]);

    $book = array("a"=>$uu);
    $json= urldecode(json_encode($book['a']));
    $json=explode('"',$json);
    $bb[0] = ltrim($bb[0],'<strong>');
    $bb[0] = rtrim($bb[0],'</strong>');

    $url=json_decode(file_get_contents('http://api.t.sina.com.cn/short_url/shorten.json?source=3271760578&url_long=http://v.sigu.me/'.$json[2]),true);
    $url_short = $url[0]['url_short'];

    echo '【在线】'.$bb[0];echo "<br>";echo $url_short;echo "<br>";
}
//搜网盘




$url=json_decode(file_get_contents("http://api.t.sina.com.cn/short_url/shorten.json?source=3271760578&url_long=http://www.repanso.com/q?wd=$unwd"),true);
//var_dump($url);exit;
$url_short = $url[0]['url_short'];
echo '【网盘】'.$wd;echo "<br>";echo $url_short;echo "<br>";

//if($tx_url_short){
//echo "PS:腾讯vip视频只破解最新两集，想看更多输入指令搜腾讯+剧名。";echo "<br>";
//}
//echo "PS省钱绝招:新增优惠券查询功能。购物之前先过来找小汁查一下是否有隐藏的优惠券吧。教程地址：http://t.cn/RBola9B";echo "<br>";
echo "PS温馨提示:公众号资源更多不失效。更多电影小说资源关注微信公众号 【微博热点排行】传送门：http://t.cn/RkHVMyX";





